// extends继承  
class Person {
    constructor(name){  //constructor函数的构造器
        this.name = name // Person内部的私有成员
    }
    say(){ //定义公共方法来， 可以对实例对象中的成员进行访问
        console.log(`hi, my name is ${this.name}`)
    }
    static creat (name) {
        console.log(this)
        return new Person(name)
    }
}  


class Student extends Person {
    constructor(name, number){
        super(name) //接收父类的属性和方法
        this.number = number
    }
    hello () {
        super.say() //接收父类中的say方法
        console.log(`my school number is ${this.number}`)
    }
}

const s = new Student('jack', 100)
s.hello()